package com.wt.struggle.goodbye.main.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.os.Message
import com.wt.struggle.goodbye.R
import com.wt.struggle.goodbye.base.ProActivity
import com.wt.struggle.goodbye.info.NetInfo
import com.xin.lv.yang.utils.utils.FileUtils
import kotlinx.android.synthetic.main.add_video_or_voice_layout.*
import kotlinx.android.synthetic.main.head.*

/**
 * 添加视频或者音频
 */
class AddVideoAndVoiceActivity : ProActivity() {
    override fun handler(what: Int, arg1: Int, netInfo: NetInfo) {

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.add_video_or_voice_layout)
        imageBack.setOnClickListener {
            finish()
        }

        tvTitle.text = "添加视频"
        tvRight.text = "保存"

        videoAdd.setOnClickListener {
            startActivityForResult(FileUtils.openVideo(),666)

        }

    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        when(requestCode){
            666->{
                if(resultCode== Activity.RESULT_OK){
                    val url=data!!.data

                }
            }
        }
    }
}